package com.lyw.forum.controller;

import com.lyw.forum.common.exception.ApplicationException;
import com.lyw.forum.pojo.response.AppResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lyw
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @RequestMapping("/exception")
    public AppResult testException() throws Exception {
        throw new Exception("这是一个Exception");
    }

    @RequestMapping("/appException")
    public AppResult testApplicationException() {
        throw new ApplicationException("这是一个ApplicationException");
    }

}
